package com.example.hello.views.users;

import com.example.hello.HelloUI;
import com.example.hello.POJO.BadgePOJO;
import com.example.hello.POJO.UserPOJO;
import com.vaadin.navigator.ViewChangeListener;

import java.util.List;

public class User_Submissions extends User {

    public User_Submissions(String NAME, UserPOJO user, List<BadgePOJO> badges) {
        super(NAME + "?tab=submissions", true, user, badges);
    }

    @Override
    public void enter(ViewChangeListener.ViewChangeEvent event) {
        currentUser = ((HelloUI) HelloUI.getCurrent()).getUser();
        if (currentUser == null) currentUser = new UserPOJO();

        checkVisible();

        submissionsLink.setActive(true);
        submissionsPane.setActive(true);
    }

}